package com.cloudfun.campusshare.repo;

import com.cloudfun.campusshare.configuration.jpa.GaodaoRepository;
import com.cloudfun.campusshare.entity.PumpWashRel;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author wangxiyuan
 * @description
 * @createDate 2021/5/21 11:45
 **/
public interface PumpWashRelRepo extends GaodaoRepository<PumpWashRel,String> {
    /**
     *
     * @param pumpImei 加液器设备Id
     * @param pumpImei 洗衣机设备Id
     * @return
     */
    PumpWashRel findAllByPumpImeiAndWashImei(String pumpImei,String washImei);

    @Query(value = "select * from pump_wash_rel where wash_imei=? and bind_status=1",nativeQuery = true)
    PumpWashRel findByWashImei(String washImei);

    @Query(value = "select * from pump_wash_rel where pump_imei=? and bind_status=1",nativeQuery = true)
    PumpWashRel findByPumpImei(String pumpImei);
}
